//----BEGIN LICENSE----//
/*****************************************************************\
** prevalentLite - sqlite3 persistence object library 
**
** Copyright (C) 2008 Philip R. Schuchardt
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program.  If not, see <http://www.gnu.org/licenses/>.
**
*****************************************************************/
//----END LICENSE----//




/*------------------------------------------------------------------------------------------------
        plLongLong is a database aware long long. It caches a long long
	in memory. When the long long is assigned, this class updates 
	the database automatically

	By: Philip Schuchardt - 2008-10-26
--------------------------------------------------------------------------------------------------*/

#ifndef plLONG_LONG_H
#define plLONG_LONG_H

//Our includes
#include "plData.h"


class plLongLong : public plData {
public:
	//Constructor
        plLongLong();

	//Constructor
        plLongLong(long long value);

	//Copy Constructor
        plLongLong(const plLongLong& obj);

        virtual ~plLongLong() { }

	//Accessor
	long long Data();

	//Modifier
	void SetData(long long value);

	//Operator overloading
	void operator=(long long value);

	//Assignment overaloading
        void operator=(const plLongLong& obj);

	operator long long();

	//Binds the data with the statement
	virtual void Bind(sqlite3_stmt* statement, int index = 1) const;

	//Gets the data from the current statement
	virtual void Column(sqlite3_stmt* statement, int index = 0);

	//The classes name
        static const char* GetClassName() { return "plLongLong"; }

private:
	long long Value;

        void Copy(const plLongLong& obj);
	
}; //end plLongLong



#endif // plLONG_LONG_H

